Allow a guest to determine its VM UUID.
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Tue, 23 May 2006 15:23:10 +0000 (16:23 +0100)
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Tue, 23 May 2006 15:23:10 +0000 (16:23 +0100)
Use xenstore-read $(xenstore-read vm)/uuid.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/python/xen/xend/XendDomainInfo.py

index 8be996c5a23a41358423bb5f331ebf9bbc3a3c75..e28f9914a10e1b880e6e2bd4413b7e7fdbc6cfda 100644 (file)
@@ -701,6 +701,16 @@ class XendDomainInfo:
         log.debug("Storing VM details: %s", to_store)
 
         self.writeVm(to_store)
+        self.setVmPermissions()
+
+
+    def setVmPermissions(self):
+        """Allow the guest domain to read its UUID.  We don't allow it to
+        access any other entry, for security."""
+        xstransact.SetPermissions('%s/uuid' % self.vmpath,
+                                  { 'dom' : self.domid,
+                                    'read' : True,
+                                    'write' : False })
 
 
     def storeDomDetails(self):